NE-2723: Migrate to aws-sdk-go-v2#1445
Conversation
|
@rikatz: This pull request references NE-2723 which is a valid jira issue. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
📝 WalkthroughWalkthroughThe PR migrates dependencies to AWS SDK for Go v2 and updates code to use v2 clients and types: rewrites the AWS Route53 DNS provider (partition-aware endpoints, tagging discovery, ELB discovery, record changes), updates shared-credentials helpers and tests to v2 config/temp-file semantics, and converts unit and e2e tests/utilities from SDK v1 to v2 while replacing deprecated ioutil usages. Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error, 1 warning, 1 inconclusive)
✅ Passed checks (9 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
test/e2e/lb_eip_test.go (1)
443-505:⚠️ Potential issue | 🟠 Major | ⚡ Quick winReturn false when EIP release fails or unassociated EIPs still exist
Line 495 can return success even when releases failed (Line 489) or when unassociated EIPs were only attempted to be released. That can stop polling early and leak EIPs.
💡 Suggested fix
func cleanupEIPAllocations(t *testing.T, svc *ec2.Client, clusterName string) bool { @@ - // Release each unassociated EIP + // Release each unassociated EIP + releaseFailed := false for _, eip := range unassociatedEIPs { _, err := svc.ReleaseAddress(context.TODO(), &ec2.ReleaseAddressInput{ AllocationId: eip.AllocationId, }) if err != nil { t.Errorf("Failed to release EIP %v with Allocation ID %v: %v", aws.ToString(eip.PublicIp), aws.ToString(eip.AllocationId), err) + releaseFailed = true } else { t.Logf("Released EIP %v with Allocation ID %v", aws.ToString(eip.PublicIp), aws.ToString(eip.AllocationId)) } } - if len(associatedEIPs) == 0 { + // Keep polling until previously-unassociated EIPs are gone from a fresh DescribeAddresses call. + if releaseFailed || len(unassociatedEIPs) > 0 { + return false + } + if len(associatedEIPs) == 0 { t.Log("No associated EIPs found with the specified tag key and value.") return true } else {🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@test/e2e/lb_eip_test.go` around lines 443 - 505, cleanupEIPAllocations currently can return true even when releasing unassociated EIPs failed or when unassociated EIPs were only attempted to be released; update the function to track release failures and only return true when there were no release errors and there are no remaining unassociated EIPs (and associatedEIPs is empty). Concretely: inside cleanupEIPAllocations, add a boolean (e.g., releaseFailed) set to true whenever svc.ReleaseAddress returns an error (instead of just t.Errorf), and after the release loop treat any releaseFailed or any non-empty unassociatedEIPs as a failure path (return false); only return true when associatedEIPs is empty AND releaseFailed is false. Reference: cleanupEIPAllocations, unassociatedEIPs, associatedEIPs, svc.ReleaseAddress.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@test/e2e/lb_eip_test.go`:
- Around line 443-505: cleanupEIPAllocations currently can return true even when
releasing unassociated EIPs failed or when unassociated EIPs were only attempted
to be released; update the function to track release failures and only return
true when there were no release errors and there are no remaining unassociated
EIPs (and associatedEIPs is empty). Concretely: inside cleanupEIPAllocations,
add a boolean (e.g., releaseFailed) set to true whenever svc.ReleaseAddress
returns an error (instead of just t.Errorf), and after the release loop treat
any releaseFailed or any non-empty unassociatedEIPs as a failure path (return
false); only return true when associatedEIPs is empty AND releaseFailed is
false. Reference: cleanupEIPAllocations, unassociatedEIPs, associatedEIPs,
svc.ReleaseAddress.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: 2c5b648a-c0c5-417c-ba11-1ec530d375b3
⛔ Files ignored due to path filters (292)
go.sumis excluded by!**/*.sumvendor/github.com/aws/aws-sdk-go-v2/LICENSE.txtis excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/NOTICE.txtis excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/accountid_endpoint_mode.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/arn/arn.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/checksum.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/config.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/context.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/credential_cache.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/credentials.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/defaults/auto.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/defaults/configuration.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/defaults/defaults.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/defaults/doc.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/defaultsmode.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/doc.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/endpoints.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/errors.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/from_ptr.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/go_module_metadata.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/logging.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/logging_generate.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/metadata.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/middleware.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/osname.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/osname_go115.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/recursion_detection.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/request_id.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/request_id_retriever.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/user_agent.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/ec2query/error_utils.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/array.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/encoder.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/map.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/middleware.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/object.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/value.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/restjson/decoder_util.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/xml/error_utils.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/ratelimit/none.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/ratelimit/token_bucket.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/ratelimit/token_rate_limit.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/request.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/retry/adaptive.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/retry/adaptive_ratelimit.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/retry/adaptive_token_bucket.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/retry/attempt_metrics.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/retry/doc.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/retry/errors.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/retry/jitter_backoff.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/retry/metadata.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/retry/middleware.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/retry/retry.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/retry/retryable_error.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/retry/standard.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/retry/throttle_error.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/retry/timeout_error.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/retryer.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/runtime.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/cache.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/const.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/header_rules.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/headers.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/hmac.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/host.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/scope.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/time.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/util.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/middleware.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/presign_middleware.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/stream.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/v4.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/to_ptr.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/client.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/content_type.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/response_error.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/response_error_middleware.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/timeout_read_closer.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/types.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/aws/version.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/config/CHANGELOG.mdis excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/config/LICENSE.txtis excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/config/auth_scheme_preference.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/config/config.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/config/defaultsmode.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/config/doc.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/config/env_config.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/config/generate.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/config/go_module_metadata.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/config/internal/ini/errors.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/config/internal/ini/ini.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/config/internal/ini/parse.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/config/internal/ini/sections.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/config/internal/ini/strings.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/config/internal/ini/token.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/config/internal/ini/tokenize.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/config/internal/ini/value.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/config/load_options.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/config/local.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/config/provider.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/config/resolve.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/config/resolve_bearer_token.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/config/resolve_credentials.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/config/shared_config.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/credentials/CHANGELOG.mdis excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/credentials/LICENSE.txtis excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/credentials/doc.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/credentials/ec2rolecreds/doc.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/credentials/ec2rolecreds/provider.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/auth.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/client.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/endpoints.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/middleware.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/provider.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/credentials/go_module_metadata.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/credentials/logincreds/dpop.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/credentials/logincreds/file.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/credentials/logincreds/provider.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/credentials/logincreds/token.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/credentials/processcreds/doc.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/credentials/processcreds/provider.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/doc.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/sso_cached_token.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/sso_credentials_provider.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/sso_token_provider.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/credentials/static_provider.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/credentials/stscreds/assume_role_provider.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/credentials/stscreds/web_identity_provider.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/CHANGELOG.mdis excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/LICENSE.txtis excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_client.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetDynamicData.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetIAMInfo.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetInstanceIdentityDocument.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetMetadata.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetRegion.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetToken.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetUserData.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/auth.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/doc.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/endpoints.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/go_module_metadata.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/internal/config/resolvers.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/request_middleware.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/token_provider.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/auth/auth.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/auth/scheme.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/bearer_token_adapter.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/bearer_token_signer_adapter.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/credentials_adapter.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/smithy.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/v4signer_adapter.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/CHANGELOG.mdis excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/LICENSE.txtis excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/config.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/endpoints.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/go_module_metadata.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/context/context.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/arn.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/doc.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/generate.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/host.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partition.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partitions.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partitions.jsonis excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/endpoints.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/CHANGELOG.mdis excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/LICENSE.txtis excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/endpoints.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/go_module_metadata.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/rand/rand.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/sdk/interfaces.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/sdk/time.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/sdkio/byte.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/shareddefaults/shared_config.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/strings/strings.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/sync/singleflight/LICENSEis excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/sync/singleflight/docs.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/sync/singleflight/singleflight.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/timeconv/duration.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/CHANGELOG.mdis excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/LICENSE.txtis excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/credentials.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/error.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/go_module_metadata.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/internal/crypto/compare.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/internal/crypto/ecc.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/internal/v4/const.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/internal/v4/header_rules.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/internal/v4/headers.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/internal/v4/hmac.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/internal/v4/host.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/internal/v4/time.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/internal/v4/util.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/middleware.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/presign_middleware.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/smithy.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/v4a.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/CHANGELOG.mdis excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/LICENSE.txtis excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_client.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AcceptAddressTransfer.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AcceptCapacityReservationBillingOwnership.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AcceptReservedInstancesExchangeQuote.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AcceptTransitGatewayClientVpnAttachment.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AcceptTransitGatewayMulticastDomainAssociations.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AcceptTransitGatewayPeeringAttachment.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AcceptTransitGatewayVpcAttachment.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AcceptVpcEndpointConnections.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AcceptVpcPeeringConnection.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AdvertiseByoipCidr.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AllocateAddress.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AllocateHosts.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AllocateIpamPoolCidr.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ApplySecurityGroupsToClientVpnTargetNetwork.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssignIpv6Addresses.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssignPrivateIpAddresses.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssignPrivateNatGatewayAddress.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateAddress.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateCapacityReservationBillingOwner.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateClientVpnTargetNetwork.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateDhcpOptions.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateEnclaveCertificateIamRole.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateIamInstanceProfile.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateInstanceEventWindow.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateIpamByoasn.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateIpamResourceDiscovery.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateNatGatewayAddress.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateRouteServer.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateRouteTable.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateSecurityGroupVpc.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateSubnetCidrBlock.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateTransitGatewayMulticastDomain.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateTransitGatewayPolicyTable.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateTransitGatewayRouteTable.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateTrunkInterface.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AssociateVpcCidrBlock.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AttachClassicLinkVpc.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AttachInternetGateway.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AttachNetworkInterface.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AttachVerifiedAccessTrustProvider.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AttachVolume.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AttachVpnGateway.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AuthorizeClientVpnIngress.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AuthorizeSecurityGroupEgress.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_AuthorizeSecurityGroupIngress.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_BundleInstance.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelBundleTask.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelCapacityReservation.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelCapacityReservationFleets.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelConversionTask.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelDeclarativePoliciesReport.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelExportTask.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelImageLaunchPermission.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelImportTask.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelReservedInstancesListing.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelSpotFleetRequests.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CancelSpotInstanceRequests.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_ConfirmProductInstance.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CopyFpgaImage.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CopyImage.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CopySnapshot.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CopyVolumes.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateCapacityManagerDataExport.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateCapacityReservation.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateCapacityReservationBySplitting.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateCapacityReservationFleet.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateCarrierGateway.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateClientVpnEndpoint.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateClientVpnRoute.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateCoipCidr.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateCoipPool.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateCustomerGateway.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateDefaultSubnet.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateDefaultVpc.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateDelegateMacVolumeOwnershipTask.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateDhcpOptions.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateEgressOnlyInternetGateway.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateFleet.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateFlowLogs.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateFpgaImage.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateImage.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateImageUsageReport.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateInstanceConnectEndpoint.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateInstanceEventWindow.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateInstanceExportTask.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateInternetGateway.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateInterruptibleCapacityReservationAllocation.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateIpam.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateIpamExternalResourceVerificationToken.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateIpamPolicy.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/ec2/api_op_CreateIpamPool.gois excluded by!**/vendor/**,!vendor/**
📒 Files selected for processing (8)
go.modpkg/dns/aws/dns.gopkg/dns/aws/dns_test.gopkg/util/aws/shared_credentials_file.gopkg/util/aws/shared_credentials_file_test.gotest/e2e/aws_util_test.gotest/e2e/lb_eip_test.gotest/e2e/operator_test.go
The aws-sdk-go library, used on DNS controller is deprecated and does not receive updates anymore. This change migrates to the new aws-sdk-go-v2, adding the new library and making the required changes to keep the code compatible
|
@coderabbitai I want you to do a full review, line by line of the changes of this PR (ignore the vendor directory!) trying to find critical or major issues, possible breaking changes, misbehaviors and mistakes that can cause issues to users. Be critical on it, as this is a very sensible change |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chainI'll read all the relevant changed files to perform the thorough review you requested. 🏁 Script executed: Length of output: 269260
🔴 Critical / Breaking Issues1. GovCloud detection change: C2S/SC2S now use Alias records instead of CNAMEFile: if isGovCloudRegion(m.route53.Options().Region) {
// CNAME path
} else {
// Alias A/AAAA path
}In v1, the helper Please verify whether the v1 2.
|
| # | Severity | File | Issue |
|---|---|---|---|
| 1 | 🔴 Critical | dns.go |
C2S/SC2S may now use Alias instead of CNAME (behavior change from v1) |
| 2 | 🔴 Critical | dns.go |
lookupZoneID returns error on first ARN parse failure without trying rest |
| 3 | 🔴 Critical | dns.go |
Empty SharedCredentialFile passed to SDK options without guard |
| 4 | 🟠 Major | dns.go + test |
resolveEndpoint is logging-only; tests don't verify actual SDK endpoints |
| 5 | 🟠 Major | dns.go |
GovCloud tagging URL override uses brittle substring matching |
| 6 | 🟠 Major | dns.go |
break in switch default for EUSC is non-idiomatic and confusing |
| 7 | 🟠 Major | dns_test.go |
Missing Test_NewProvider case for EUSC with default endpoints |
| 8 | 🟠 Major | dns.go |
No dual-stack (AAAA) support in GovCloud CNAME path |
| 9 | 🟡 Minor | lb_eip_test.go |
Deprecated rand.Seed |
| 10 | 🟡 Minor | operator_test.go |
Deprecated io/ioutil not cleaned up |
| 11 | 🟡 Minor | dns.go |
Pervasive context.TODO() prevents timeout/cancellation propagation |
| 12 | 🟡 Minor | dns.go |
resolveEndpoint silently returns "" for tagging in iso partitions |
| 13 | 🟡 Minor | dns.go |
Shallow copy of cfg into cfgRoute53 — intent should be commented |
The most important item to verify before merging is Issue #1 (the GovCloud detection change affecting C2S/SC2S). The rest are important quality/robustness issues but lower risk for standard AWS deployments.
|
@coderabbitai about your finding 1, The v1 Route53 endpoint for us-iso-east-1 would have been https://route53.c2s.ic.gov — which does NOT contain "us-gov". So clientEndpointIsGovCloud returned false for C2S/SC2S |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 988 🏁 Script executed: Length of output: 741 🏁 Script executed: Length of output: 392
govCloudRoute53Region = "us-gov" // line 46
func clientEndpointIsGovCloud(clientInfo *metadata.ClientInfo) bool {
return strings.Contains(clientInfo.Endpoint, govCloudRoute53Region)
}The v1 function checked whether the Route53 endpoint URL contained The v2 ✏️ Learnings added
|
|
@coderabbitai some more assessment from your comments: comment on all of them and if so, do another review line by line checking if all of your concerns are addressed |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 71906
Acknowledged Invalid Findings (with v1 evidence)#2 — #3 — Empty #4 — Tests don't verify actual SDK endpoints: Confirmed. In v2 there is no #5 — GovCloud tagging URL substring match: Confirmed. v1 lines 247–250 contain the identical #6 — #8 — No dual-stack in GovCloud CNAME path: Confirmed. v1 #12 — #13 (self-correction) — Fresh Line-by-Line Re-ReviewWith all 8 invalidated findings set aside, here is a clean pass on what genuinely remains. 🟠 Remaining Major Issue#7 — No The test file covers EUSC only with custom service endpoints: {
name: "custom service endpoints, EUSC Brandenburg",
config: Config{
Region: "eusc-de-east-1",
ServiceEndpoints: []ServiceEndpoint{...},
},
...
}There is no test case for {
name: "default service endpoints, EUSC Brandenburg",
config: Config{
Region: "eusc-de-east-1",
},
expectedTaggingServiceEndpoint: "https://tagging.eusc-de-east-1.amazonaws.eu",
expectedElbServiceEndpointEndpoint: "https://elasticloadbalancing.eusc-de-east-1.amazonaws.eu",
expectedElbv2ServiceEndpointEndpoint: "https://elasticloadbalancing.eusc-de-east-1.amazonaws.eu",
expectedRoute53ServiceEndpoint: "https://route53.amazonaws.eu",
},🟡 Remaining Minor Issues#9 — No-op rand.Seed(time.Now().UnixNano())This uses #10 — Deprecated Lines 992, 2473, 2615, 2887, 3260, and 3333 still use #11 — Pervasive All AWS API calls in Summary of Remaining Items
No new critical or breaking issues found in the fresh pass. The migration is behaviorally faithful to v1. The only concrete code suggestion I'd flag before merging is #7 (EUSC default-endpoint test case). ✏️ Learnings added
|
|
@coderabbitai do the same review I have asked you again, line by line, critical and major findings, adversarial (give me reasons not to merge, if you have some). Also verify why ci/prow/e2e-aws-operator execution failed before, and if it is related with this PR |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chainI'll do the fresh adversarial re-review and simultaneously investigate the CI failure. 🏁 Script executed: Length of output: 81698 All CI checks are currently PENDING (re-triggered just now at ~12:01 UTC). Let me check what the previous failure was, and simultaneously verify the Let me check the prow job history for the previous failed run. 🏁 Script executed: Length of output: 8730 Found the previous failed run. Let me fetch its logs to diagnose the failure. Let me fetch the specific prow job logs directly. 🏁 Script executed: Length of output: 2737 Good - confirmed FAILURE on the previous commit. Now let me get the build log and test results. 🏁 Script executed: Length of output: 22299 Found the failing test: 🏁 Script executed: Length of output: 12999 Let me get the detailed test artifacts for the specific failure. 🏁 Script executed: Length of output: 33121
Fresh Adversarial Re-Review✅ Correction from previous round: Finding
|
| Failed test | TestManagedDNSToUnmanagedDNSIngressController |
| Error | DNSRecord zone expected to have status=Unknown but got status=True |
| Path exercised | DNS Delete path (managed→unmanaged transition) |
| PR-related? | Suspicious — this test exclusively exercises the DNS delete path which this PR rewrites, and the inverse test (unmanaged→managed, DNS create) passed. |
| Verdict | Do not merge until the re-triggered CI run passes. If it fails again, instrument the Delete/updateRecord code path with more diagnostic logging and verify the error detection logic (Finding #2 above). |
✏️ Learnings added
Learnt from: rikatz
URL: https://github.com/openshift/cluster-ingress-operator/pull/1445
Timestamp: 2026-05-14T12:10:08.890Z
Learning: In the cluster-ingress-operator (pkg/dns/aws/dns.go) v2 migration PR `#1445`, the `TestManagedDNSToUnmanagedDNSIngressController` e2e test failed on a previous commit (6d8c121f) with error "DNSRecord zone expected to have status=Unknown but got status=True" - meaning after switching to UnmanagedLoadBalancerDNS, the internal zone's DNSRecord condition was still True instead of Unknown. This test exercises the DNS DELETE/disownment path which was rewritten in the v2 migration.
Learnt from: rikatz
URL: https://github.com/openshift/cluster-ingress-operator/pull/1445
Timestamp: 2026-05-14T12:10:08.890Z
Learning: In cluster-ingress-operator pkg/dns/aws/dns.go (PR `#1445`), Test_NewProvider does include a "default service endpoints, EUSC Brandenburg" test case with no ServiceEndpoints configured - verifying default endpoint resolution for eusc-de-east-1. Finding that this test was missing was incorrect.
Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.
|
The test that I care right now is e2e-aws-operator, which is flaky by different reasons apparently, so let me try again /test e2e-aws-operator |
|
/retest-required |
|
@coderabbitai the last test passed on aws-operator pipeline. I want you to do a new full adversarial review, line by line of the changes and the proposal, but keep yourself in the current context of the change: bumping to aws-sdk-go-v2. Is there any good reason not to merge this? |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 84378
Final Adversarial Line-by-Line Review🟢 Items Previously Flagged — Confirmed Resolved or Invalid
🔍 New Pass — Items Examined Fresh1. if strings.Contains(apiErr.ErrorMessage(), "not found") {This is unchanged v1 behavior. The v2 type system makes a code-based check trivial to add ( 2. If an account has zero hosted zones, the paginator fires once, 3. aliasTarget := &r53types.AliasTarget{...}
changes := []r53types.Change{{..., AliasTarget: aliasTarget}}
if awsutil.IsDualStack(...) {
changes = append(changes, r53types.Change{{..., AliasTarget: aliasTarget}})
}Both changes point to the same 4. No file in vendor directly imports this package. It is a transitive dependency of 5. tagInput := resourcegroupstaggingapi.GetResourcesInput{TagsPerPage: aws.Int32(100)}This is explicitly just a connectivity check (the result is discarded). Fetching up to 100 resources once at startup to confirm the tagging endpoint is reachable is correct and cheap. Fine. 6. Test coverage completeness
7. All added modules are purposeful: core v2 ( VerdictThe migration is behaviorally faithful to v1 across all partitions, test-covered for all supported region types, passing CI (including the previously failed delete-path test), and the code is clean and well-commented. There is no good reason not to merge. The only two items worth noting as optional follow-ups (not blockers):
Neither is introduced by this PR and neither affects any real deployment scenario. |
|
/retest-required |
|
@coderabbitai verify if the last pipeline failures at #1445 (comment) are related to this PR changes |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 18389 Let me fetch the actual failure logs for the three OVN jobs to diagnose the root cause. 🏁 Script executed: Length of output: 54174
|
| Job | Failure Cause | PR-related? |
|---|---|---|
e2e-aws-ovn |
Kubelet pod sandbox creation failed — CI infra issue | ❌ No |
e2e-aws-ovn-serial-1of2 |
oc adm upgrade recommend test — sig-cli/OTA test |
❌ No |
e2e-aws-ovn-serial-2of2 |
Platform MonitorTest invariant failure | ❌ No |
Critically, the job that directly exercises your changes — ci/prow/e2e-aws-operator — passed ✅ (along with e2e-azure-operator, e2e-gcp-operator, e2e-aws-operator-techpreview, e2e-aws-ovn-upgrade, and 4 others). The /retest-required you just triggered will rerun the three OVN jobs, and given the failure patterns, they are expected to be CI environment flakiness. You should not be concerned about this PR's code being the cause.
|
/assign |
|
/retest-required |
|
/lgtm Looks great! |
| UseDualStack: aws.Bool(false), | ||
| }) | ||
| if err != nil { | ||
| return "" |
There was a problem hiding this comment.
silently ignoring without logging, we need to log
|
@coderabbitai I want you to do a new full adversarial review, line by line of the changes and the proposal, but keep yourself in the current context of the change: bumping to aws-sdk-go-v2. Is there any good reason not to merge this? Also ignore any changes on the vendor/ directory, and focus on the main code |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
echo "=== pkg/dns/aws/dns.go ==="
cat pkg/dns/aws/dns.go
echo ""
echo "=== pkg/dns/aws/dns_test.go ==="
cat pkg/dns/aws/dns_test.go
echo ""
echo "=== pkg/util/aws/shared_credentials_file.go ==="
cat pkg/util/aws/shared_credentials_file.go
echo ""
echo "=== pkg/util/aws/shared_credentials_file_test.go ==="
cat pkg/util/aws/shared_credentials_file_test.go
echo ""
echo "=== test/e2e/aws_util_test.go ==="
cat test/e2e/aws_util_test.go
echo ""
echo "=== test/e2e/lb_eip_test.go ==="
cat test/e2e/lb_eip_test.go
echo ""
echo "=== test/e2e/operator_test.go — imports + assertEIPAllocationDeleted + ioutil usage ==="
head -80 test/e2e/operator_test.go
grep -n "ioutil\|io\.Discard\|io\.ReadAll\|assertEIPAlloc\|createEC2\|getPublicSubnet\|getVPCId" test/e2e/operator_test.go | head -50
echo ""
echo "=== go.mod (AWS / smithy lines) ==="
grep -n "aws\|smithy\|jmespath\|signin" go.mod
echo ""
echo "=== Check GovCloud region helpers ==="
grep -n -A 10 "func isGovCloudRegion\|func partitionIDForRegion" pkg/dns/aws/dns.go
echo ""
echo "=== Check all smithy / error handling in dns.go ==="
grep -n -B2 -A8 "smithy\|errors\.As\|not found\|InvalidChangeBatch\|ErrorCode\|ErrorMessage" pkg/dns/aws/dns.go
echo ""
echo "=== Check context usage in dns.go ==="
grep -n "context\." pkg/dns/aws/dns.go | head -40
echo ""
echo "=== Check all pagination calls ==="
grep -n "NewGetResourcesPaginator\|NewListHostedZonesPaginator\|NewDescribeLoadBalancersPaginator\|HasMorePages\|NextPage" pkg/dns/aws/dns.go
echo ""
echo "=== Check validateServiceEndpoints ==="
grep -n -A 60 "func.*validateServiceEndpoints" pkg/dns/aws/dns.go
echo ""
echo "=== Check resolveEndpoint ==="
grep -n -A 80 "func.*resolveEndpoint" pkg/dns/aws/dns.go
echo ""
echo "=== Check RoleARN assumption code ==="
grep -n -A 20 "RoleARN" pkg/dns/aws/dns.go
echo ""
echo "=== Check updateRecord full function ==="
grep -n -A 120 "func.*updateRecord" pkg/dns/aws/dns.go
echo ""
echo "=== Check Delete function ==="
grep -n -A 30 "func.*Delete\b" pkg/dns/aws/dns.go
echo ""
echo "=== Check lookupZoneID variants ==="
grep -n -A 60 "func.*lookupZoneID" pkg/dns/aws/dns.go
echo ""
echo "=== Check all constants ==="
grep -n "const\|= \"" pkg/dns/aws/dns.go | head -60
echo ""
echo "=== Check for any TODO/FIXME/HACK in changed non-vendor files ==="
grep -rn "TODO\|FIXME\|HACK\|XXX" pkg/dns/aws/ pkg/util/aws/ test/e2e/aws_util_test.go test/e2e/lb_eip_test.go 2>/dev/null | grep -v "vendor" | head -30
echo ""
echo "=== Check for nil pointer risks in dns.go ==="
grep -n "\.Tags\b\|\.ResourceARN\b\|\.HostedZoneId\b\|aws\.ToString" pkg/dns/aws/dns.go | head -40
echo ""
echo "=== Check test coverage for GovCloud specific paths ==="
grep -n "gov\|GovCloud\|us-gov" pkg/dns/aws/dns_test.go | head -30
echo ""
echo "=== Check v1 pre-migration commit for NewProvider to see credential file handling ==="
git show d16dd454:pkg/dns/aws/dns.go 2>/dev/null | grep -n -B5 -A15 "SharedCredentialFile\|NewSessionWithOptions\|session\.Must"Length of output: 105849
Final Adversarial Review✅ Everything Previously Flagged — Confirmed Resolved or InvalidAll findings from the prior two rounds have been addressed, confirmed as v1 parity behavior, or confirmed as inherent v2 limitations with no regression impact. No re-hash needed. 🔍 Fresh Pass — New Items Examined1. GovCloud if region == "us-gov-east-1" {
log.Info("Ignoring custom resourcegroupstaggingapi endpoint...")
} else {
tagEndpoint = ep.URL
}This is actually better than v1, which used 2. if len(resp.HostedZones) == 0 {
continue
}This guard was added in the v2 migration and is actually more defensive than v1. It prevents calling 3. In v1, endpoint strings were hand-constructed ( 4. Lock discipline — no new races (Lines 482–670)
5. The comment above the constants block explicitly documents why these are hardcoded ( 6. No Go file in the repo (or vendor) directly imports this package. It's a transitive dependency of 7. Test coverage completeness
Remaining Items (not blocking, all pre-existing v1 behavior)
VerdictThere is no code-level reason not to merge this PR. The migration is:
The |
There was a problem hiding this comment.
🧹 Nitpick comments (9)
pkg/dns/aws/dns.go (9)
558-560: ⚡ Quick winUse
%wfor error wrapping.Proposed fix
resp, err := paginator.NextPage(ctx) if err != nil { - return "", fmt.Errorf("failed to list hosted zones: %v", err) + return "", fmt.Errorf("failed to list hosted zones: %w", err) }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pkg/dns/aws/dns.go` around lines 558 - 560, The error returned from paginator.NextPage(ctx) is being wrapped with fmt.Errorf using %v; change the wrapping to use %w so the original error is preserved for unwrapping. Locate the block where paginator.NextPage(ctx) is called (the paginator.NextPage call and the fmt.Errorf on failure) and replace the fmt.Errorf("failed to list hosted zones: %v", err) usage with fmt.Errorf("failed to list hosted zones: %w", err) to enable proper error wrapping/unwrapping.
757-759: ⚡ Quick winUse
%wfor error wrapping.Proposed fix
err = m.updateRecord(domain, zoneID, target, targetHostedZoneID, string(action), record.Spec.RecordTTL) if err != nil { - return fmt.Errorf("failed to update alias in zone %s: %v", zoneID, err) + return fmt.Errorf("failed to update alias in zone %s: %w", zoneID, err) }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pkg/dns/aws/dns.go` around lines 757 - 759, The fmt.Errorf call that reports an error from m.updateRecord should wrap the original error using %w instead of %v so callers can inspect/unwrap it; locate the call to m.updateRecord (passing domain, zoneID, target, targetHostedZoneID, string(action), record.Spec.RecordTTL) and change the fmt.Errorf("failed to update alias in zone %s: %v", zoneID, err) to use %w (e.g., fmt.Errorf("failed to update alias in zone %s: %w", zoneID, err)) so the error is properly wrapped.
269-269: ⚡ Quick winUse
%wfor error wrapping to enableerrors.Is()/errors.As()unwrapping.Per coding guidelines, wrapped errors should use
%winstead of%v.Proposed fix
- return nil, fmt.Errorf("couldn't create AWS client config: %v", err) + return nil, fmt.Errorf("couldn't create AWS client config: %w", err)As per coding guidelines: "Return errors with context using
fmt.Errorf("<action>: %w", err)and always use%wfor wrapped error values to allowerrors.Is()/errors.As()unwrapping"🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pkg/dns/aws/dns.go` at line 269, Replace the fmt.Errorf call that currently uses "%v" to wrap the underlying error with "%w" so callers can use errors.Is()/errors.As(); specifically change the return that reads `fmt.Errorf("couldn't create AWS client config: %v", err)` to use `fmt.Errorf("couldn't create AWS client config: %w", err)` (locate this in pkg/dns/aws/dns.go in the AWS client config creation/initialization block).
453-472: ⚡ Quick winUse
%wfor error wrapping in validation errors.Multiple error wrappings in this function use
%vinstead of%w.Proposed fix
if _, err := provider.route53.ListHostedZones(ctx, &zoneInput); err != nil { - errs = append(errs, fmt.Errorf("failed to list route53 hosted zones: %v", err)) + errs = append(errs, fmt.Errorf("failed to list route53 hosted zones: %w", err)) } elbInput := elasticloadbalancing.DescribeLoadBalancersInput{PageSize: aws.Int32(1)} if _, err := provider.elb.DescribeLoadBalancers(ctx, &elbInput); err != nil { - errs = append(errs, fmt.Errorf("failed to describe elb load balancers: %v", err)) + errs = append(errs, fmt.Errorf("failed to describe elb load balancers: %w", err)) } elbv2Input := elbv2.DescribeLoadBalancersInput{PageSize: aws.Int32(1)} if _, err := provider.elbv2.DescribeLoadBalancers(ctx, &elbv2Input); err != nil { - errs = append(errs, fmt.Errorf("failed to describe elbv2 load balancers: %v", err)) + errs = append(errs, fmt.Errorf("failed to describe elbv2 load balancers: %w", err)) } if provider.tags != nil { tagInput := resourcegroupstaggingapi.GetResourcesInput{TagsPerPage: aws.Int32(100)} if _, err := provider.tags.GetResources(ctx, &tagInput); err != nil { - errs = append(errs, fmt.Errorf("failed to get group tagging resources: %v", err)) + errs = append(errs, fmt.Errorf("failed to get group tagging resources: %w", err)) } }As per coding guidelines: "Return errors with context using
fmt.Errorf("<action>: %w", err)and always use%wfor wrapped error values"🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pkg/dns/aws/dns.go` around lines 453 - 472, The error constructions in this validation block (the errs slice population around provider.route53.ListHostedZones, provider.elb.DescribeLoadBalancers, provider.elbv2.DescribeLoadBalancers, and provider.tags.GetResources) use fmt.Errorf with "%v"; replace each fmt.Errorf("...: %v", err) with fmt.Errorf("...: %w", err) so errors are properly wrapped (e.g., change fmt.Errorf("failed to list route53 hosted zones: %v", err) to fmt.Errorf("failed to list route53 hosted zones: %w", err)); keep the same messages and return kerrors.NewAggregate(errs) as before.
825-836: ⚡ Quick winUse
%wfor error wrapping.Proposed fix
resp, err := m.route53.ChangeResourceRecordSets(context.TODO(), &input) if err != nil { if action == string(deleteAction) { var apiErr smithy.APIError if errors.As(err, &apiErr) { if strings.Contains(apiErr.ErrorMessage(), "not found") { log.Info("record not found", "zone id", zoneID, "domain", domain, "target", target) return nil } } } - return fmt.Errorf("couldn't update DNS record in zone %s: %v", zoneID, err) + return fmt.Errorf("couldn't update DNS record in zone %s: %w", zoneID, err) }As per coding guidelines: "Return errors with context using
fmt.Errorf("<action>: %w", err)"🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pkg/dns/aws/dns.go` around lines 825 - 836, The error return uses fmt.Errorf with %v which loses the wrapped error; change the return to wrap the original error using %w so callers can inspect it. Specifically, in the block after calling ChangeResourceRecordSets (around ChangeResourceRecordSets, deleteAction and apiErr), replace fmt.Errorf("couldn't update DNS record in zone %s: %v", zoneID, err) with fmt.Errorf("couldn't update DNS record in zone %s: %w", zoneID, err) so the original error is preserved and can be unwrapped.
536-543: ⚡ Quick winUse
%wfor error wrapping in lookupZoneID.Proposed fix
resp, err := paginator.NextPage(ctx) if err != nil { - return "", fmt.Errorf("failed to get tagged resources: %v", err) + return "", fmt.Errorf("failed to get tagged resources: %w", err) } for _, zone := range resp.ResourceTagMappingList { zoneARN, err := arn.Parse(aws.ToString(zone.ResourceARN)) if err != nil { - return "", fmt.Errorf("failed to parse hostedzone ARN %q: %v", aws.ToString(zone.ResourceARN), err) + return "", fmt.Errorf("failed to parse hostedzone ARN %q: %w", aws.ToString(zone.ResourceARN), err) }As per coding guidelines: "Return errors with context using
fmt.Errorf("<action>: %w", err)"🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pkg/dns/aws/dns.go` around lines 536 - 543, In lookupZoneID, the error returns use %v instead of wrapping the underlying error; change the fmt.Errorf calls that follow paginator.NextPage(ctx) and arn.Parse(...) to use %w so callers can inspect the original error (e.g. replace fmt.Errorf("failed to get tagged resources: %v", err) with fmt.Errorf("failed to get tagged resources: %w", err) and fmt.Errorf("failed to parse hostedzone ARN %q: %v", aws.ToString(zone.ResourceARN), err) with fmt.Errorf("failed to parse hostedzone ARN %q: %w", aws.ToString(zone.ResourceARN), err)); keep the same messages and context and ensure this applies to any other fmt.Errorf in lookupZoneID that wraps returned errors.
632-654: ⚡ Quick winUse
%wfor error wrapping in ELB discovery.Proposed fix
resp, err := elbPaginator.NextPage(ctx) if err != nil { - return "", fmt.Errorf("failed to describe classic load balancers: %v", err) + return "", fmt.Errorf("failed to describe classic load balancers: %w", err) }resp, err := elbv2Paginator.NextPage(ctx) if err != nil { - return "", fmt.Errorf("failed to describe network load balancers: %v", err) + return "", fmt.Errorf("failed to describe network load balancers: %w", err) }As per coding guidelines: "Return errors with context using
fmt.Errorf("<action>: %w", err)"🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pkg/dns/aws/dns.go` around lines 632 - 654, The error returns from elbPaginator.NextPage and elbv2Paginator.NextPage currently use fmt.Errorf with %v (e.g., fmt.Errorf("failed to describe classic load balancers: %v", err)), so update both to wrap the original error using %w (e.g., fmt.Errorf("failed to describe classic load balancers: %w", err)) for elbPaginator.NextPage and similarly for elbv2Paginator.NextPage to ensure proper error wrapping; change both fmt.Errorf calls that reference err to use %w.
444-444: ⚡ Quick winUse
%wfor error wrapping.Proposed fix
- return nil, fmt.Errorf("failed to validate aws provider service endpoints: %v", err) + return nil, fmt.Errorf("failed to validate aws provider service endpoints: %w", err)As per coding guidelines: "Return errors with context using
fmt.Errorf("<action>: %w", err)and always use%wfor wrapped error values"🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pkg/dns/aws/dns.go` at line 444, Replace the fmt.Errorf call that returns the validation error in pkg/dns/aws (the return nil, fmt.Errorf("failed to validate aws provider service endpoints: %v", err) statement) to wrap the original error with %w instead of %v; update the error formatting so the returned error uses fmt.Errorf("failed to validate aws provider service endpoints: %w", err) to preserve error wrapping semantics.
712-720: ⚡ Quick winUse
%wfor error wrapping.Proposed fix
zoneID, err := m.getZoneID(zone) if err != nil { - return fmt.Errorf("failed to find hosted zone for record: %v", err) + return fmt.Errorf("failed to find hosted zone for record: %w", err) } // Find the target hosted zone of the load balancer attached to the service. targetHostedZoneID, err := m.getLBHostedZone(target) if err != nil { - err = fmt.Errorf("failed to get hosted zone for load balancer target %q: %v", target, err) + err = fmt.Errorf("failed to get hosted zone for load balancer target %q: %w", target, err)As per coding guidelines: "Return errors with context using
fmt.Errorf("<action>: %w", err)"🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pkg/dns/aws/dns.go` around lines 712 - 720, The error constructed when getLBHostedZone(target) fails uses fmt.Errorf with %v instead of wrapping the original error; update the error assignment in the block that calls getLBHostedZone (where targetHostedZoneID, err := m.getLBHostedZone(target) is handled) to wrap the original err using fmt.Errorf("failed to get hosted zone for load balancer target %q: %w", target, err) so the underlying error is preserved and can be unwrapped.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@pkg/dns/aws/dns.go`:
- Around line 558-560: The error returned from paginator.NextPage(ctx) is being
wrapped with fmt.Errorf using %v; change the wrapping to use %w so the original
error is preserved for unwrapping. Locate the block where
paginator.NextPage(ctx) is called (the paginator.NextPage call and the
fmt.Errorf on failure) and replace the fmt.Errorf("failed to list hosted zones:
%v", err) usage with fmt.Errorf("failed to list hosted zones: %w", err) to
enable proper error wrapping/unwrapping.
- Around line 757-759: The fmt.Errorf call that reports an error from
m.updateRecord should wrap the original error using %w instead of %v so callers
can inspect/unwrap it; locate the call to m.updateRecord (passing domain,
zoneID, target, targetHostedZoneID, string(action), record.Spec.RecordTTL) and
change the fmt.Errorf("failed to update alias in zone %s: %v", zoneID, err) to
use %w (e.g., fmt.Errorf("failed to update alias in zone %s: %w", zoneID, err))
so the error is properly wrapped.
- Line 269: Replace the fmt.Errorf call that currently uses "%v" to wrap the
underlying error with "%w" so callers can use errors.Is()/errors.As();
specifically change the return that reads `fmt.Errorf("couldn't create AWS
client config: %v", err)` to use `fmt.Errorf("couldn't create AWS client config:
%w", err)` (locate this in pkg/dns/aws/dns.go in the AWS client config
creation/initialization block).
- Around line 453-472: The error constructions in this validation block (the
errs slice population around provider.route53.ListHostedZones,
provider.elb.DescribeLoadBalancers, provider.elbv2.DescribeLoadBalancers, and
provider.tags.GetResources) use fmt.Errorf with "%v"; replace each
fmt.Errorf("...: %v", err) with fmt.Errorf("...: %w", err) so errors are
properly wrapped (e.g., change fmt.Errorf("failed to list route53 hosted zones:
%v", err) to fmt.Errorf("failed to list route53 hosted zones: %w", err)); keep
the same messages and return kerrors.NewAggregate(errs) as before.
- Around line 825-836: The error return uses fmt.Errorf with %v which loses the
wrapped error; change the return to wrap the original error using %w so callers
can inspect it. Specifically, in the block after calling
ChangeResourceRecordSets (around ChangeResourceRecordSets, deleteAction and
apiErr), replace fmt.Errorf("couldn't update DNS record in zone %s: %v", zoneID,
err) with fmt.Errorf("couldn't update DNS record in zone %s: %w", zoneID, err)
so the original error is preserved and can be unwrapped.
- Around line 536-543: In lookupZoneID, the error returns use %v instead of
wrapping the underlying error; change the fmt.Errorf calls that follow
paginator.NextPage(ctx) and arn.Parse(...) to use %w so callers can inspect the
original error (e.g. replace fmt.Errorf("failed to get tagged resources: %v",
err) with fmt.Errorf("failed to get tagged resources: %w", err) and
fmt.Errorf("failed to parse hostedzone ARN %q: %v",
aws.ToString(zone.ResourceARN), err) with fmt.Errorf("failed to parse hostedzone
ARN %q: %w", aws.ToString(zone.ResourceARN), err)); keep the same messages and
context and ensure this applies to any other fmt.Errorf in lookupZoneID that
wraps returned errors.
- Around line 632-654: The error returns from elbPaginator.NextPage and
elbv2Paginator.NextPage currently use fmt.Errorf with %v (e.g.,
fmt.Errorf("failed to describe classic load balancers: %v", err)), so update
both to wrap the original error using %w (e.g., fmt.Errorf("failed to describe
classic load balancers: %w", err)) for elbPaginator.NextPage and similarly for
elbv2Paginator.NextPage to ensure proper error wrapping; change both fmt.Errorf
calls that reference err to use %w.
- Line 444: Replace the fmt.Errorf call that returns the validation error in
pkg/dns/aws (the return nil, fmt.Errorf("failed to validate aws provider service
endpoints: %v", err) statement) to wrap the original error with %w instead of
%v; update the error formatting so the returned error uses fmt.Errorf("failed to
validate aws provider service endpoints: %w", err) to preserve error wrapping
semantics.
- Around line 712-720: The error constructed when getLBHostedZone(target) fails
uses fmt.Errorf with %v instead of wrapping the original error; update the error
assignment in the block that calls getLBHostedZone (where targetHostedZoneID,
err := m.getLBHostedZone(target) is handled) to wrap the original err using
fmt.Errorf("failed to get hosted zone for load balancer target %q: %w", target,
err) so the underlying error is preserved and can be unwrapped.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: 7d82550a-1cb6-40b9-b2ab-62bcaf2bbed8
📒 Files selected for processing (1)
pkg/dns/aws/dns.go
|
/hold cancel this now seems ready to go 👋 |
|
/lgtm |
|
/test list |
|
@melvinjoseph86: The specified target(s) for The following commands are available to trigger optional jobs: Use DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/payload-job periodic-ci-openshift-openshift-tests-private-release-5.0-amd64-nightly-aws-usgov-ipi-custom-dns-mini-perm-tp-f7 |
|
@melvinjoseph86: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command
See details on https://pr-payload-tests.ci.openshift.org/runs/ci/20c330c0-5e7a-11f1-9fe2-13e38a39695c-0 |
|
/payload-job periodic-ci-openshift-openshift-tests-private-release-5.0-amd64-nightly-aws-usgov-ipi-private-ep-fips-f7 periodic-ci-openshift-openshift-tests-private-release-5.0-amd64-nightly-aws-usgov-ipi-private-sts-f7 |
|
@melvinjoseph86: trigger 2 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command
See details on https://pr-payload-tests.ci.openshift.org/runs/ci/4bf89780-5e7a-11f1-8850-f848f373f480-0 |
|
/payload-job periodic-ci-openshift-openshift-tests-private-release-5.0-amd64-nightly-aws-usgov-ipi-private-ep-fips-f7 periodic-ci-openshift-openshift-tests-private-release-5.0-amd64-nightly-aws-usgov-ipi-private-sts-f7 periodic-ci-openshift-openshift-tests-private-release-5.0-amd64-nightly-aws-usgov-ipi-custom-dns-mini-perm-tp-f7 |
|
@melvinjoseph86: trigger 3 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command
See details on https://pr-payload-tests.ci.openshift.org/runs/ci/04514cc0-5f2d-11f1-87b2-b2ae608b681d-0 |
|
/payload-job periodic-ci-openshift-openshift-tests-private-release-5.0-amd64-nightly-aws-usgov-ipi-private-ep-fips-f7 periodic-ci-openshift-openshift-tests-private-release-5.0-amd64-nightly-aws-usgov-ipi-private-sts-f7 periodic-ci-openshift-openshift-tests-private-release-5.0-amd64-nightly-aws-usgov-ipi-custom-dns-mini-perm-tp-f7 |
|
@melvinjoseph86: trigger 3 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command
See details on https://pr-payload-tests.ci.openshift.org/runs/ci/428e4700-5f7c-11f1-8cad-766508e7bd57-0 |
|
Tested with cluster bot and automation run with OCP48138 passes Also able to create the dnsrecord correctly in internal LB: Hence marking as verified |
|
@melvinjoseph86: This PR has been marked as verified by DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
@rikatz: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
What
Migrate the AWS DNS provider from the deprecated aws-sdk-go (v1) to aws-sdk-go-v2.
Why
github.com/aws/aws-sdk-go reached end-of-support on July 31, 2025 and no longer receives security patches, bug fixes, or new service/region support. The cluster-ingress-operator uses the AWS SDK for Route53 DNS management, ELB/ELBv2 load balancer discovery, tag-based resource lookups, and STS cross-account role assumption — all of which need to stay on an actively maintained SDK.
Changes